package com.zhouhailin.oomdemo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author：zhouhailin
 * @Date： 2023/3/7
 */
@RestController
public class OOM {

    private static Map<String, String> map = new HashMap<>();

    @RequestMapping("/oom")
    public String oom() throws Exception {
        for (int i = 0; i < 100000; i++) {
            map.put("key" + i, "value" + i);
        }
        return "oom";
    }

    /**
     * 测试
     *
     * @return Success
     */
    @RequestMapping("/test")
    public Object test() {
        System.out.println("hello");
        return "Success!";
    }
}
